public class Test1 {
    public static void main(String[] args) {
        int b[][] = {{100, 88, 98, 85, 92}, {89, 74, 75, 66, 86}, {88, 87, 89, 90, 78}};
        //假如b中存储的是3个同学的5门课成绩
        //1、求出每个同学的总分和平均分
        for (int i = 0; i < b.length; i++) {
            int total = 0;
            for (int j = 0; j < b[i].length; j++) {
                total += b[i][j];
            }
            System.out.println("第" + (i+1) + "个同学的总分是：" + total + ",平均分为：" + total / b[i].length);
        }

        //2、求出所有同学加在一起的总分
        int all_total = 0;
        for (int i = 0; i < b.length; i++) {
            for (int j = 0; j < b[i].length; j++) {
                all_total += b[i][j];
            }
        }
        System.out.println("所有同学加在一起的总分是：" + all_total);
        //3、求出每门课的平均分
        for (int i = 0; i < b[0].length; i++) {
            int class_Average = 0;
            for (int j = 0; j < b.length; j++) {
                class_Average +=b[j][i];
            }
            System.out.println("每门课的平均分为："+class_Average/b.length);
        }


        //Ctrl+A全选 ，Ctrl+C 复制，Ctrl+V，粘贴到src目录

    }
}



